#!/bin/bash
# 

bash_number=0
nologin_number=0
number=$(wc -l /etc/passwd |awk '{print $1}')
#按数字的方式读取文件
for i in $(seq $number ); do
    sh_name=$(head -n $i /etc/passwd | tail -n 1 | awk -F: '{print $7 }')
    if [ $sh_name == "/bin/bash" ]; then
       let bash_number++
   elif [ $sh_name == "/sbin/nologin" ]; then
       let nologin_number++
    fi
done

echo "bash用户数：$bash_number, nologin用户数：$nologin_number"
